namespace Blog2025.Application.Common;

public class PageResult
{
    // 用于保存分页数据

    public int TotalCount { get; set; }
    public object? Items { get; set; }
    public int PageIndex { get; set; }
    public int PageSize { get; set; }
    public int TotalPage { get; set; }

    public static PageResult Success(int totalCount =0 , int totalPage =1, int pageIndex=1, int pageSize = 10, object? items = null)
    {
        return new PageResult
        {
            TotalCount = totalCount,
            TotalPage = totalPage,
            PageIndex = pageIndex,
            PageSize = pageSize,
            Items = items
        };
    }
}